import  {mapMutations} from  "vuex"
export const  changeNav = {
    data(){
        return  {
            userid:""
        }
    },
    methods:{
        ...mapMutations(["changeFlag"])
    },
    created(){
        let userinfo = window.localStorage.getItem("userinfo");
        if(userinfo){
            userinfo = JSON.parse(userinfo);
            let userid = userinfo.id; //用户编号
            this.userid = userid;
        }
       

    },
    mounted(){
        this.changeFlag(false);
    },
    destroyed() {
        this.changeFlag(true);
    },
}